﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CompanyList.aspx.cs" Inherits="admin_company_CompanyList" %>


 
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>阳澄湖牌 </title>
    <link href="../main.css" rel="stylesheet" type="text/css" />
    <script language="JavaScript" type="text/javascript" src="../js/main.js"></script>
	<script type="text/javascript" language="javascript">
	    function CheckSelect(del, str) {
	        var rt = true;
	        var num = 0;
	        var boxorder = 0;
	        var objCheckBox;
	        for (var i = 0; i < form1.length; i++) {
	            ///alert(form1.elements[i].type);
	            if (form1.elements[i].type == "checkbox") {
	                boxorder++;
	                objCheckBox = form1.elements[i];
	                ///alert(objCheckBox.checked);
	                if (objCheckBox.checked) {
	                    if (boxorder > 1) {
	                        //如果是第一个CheckBox，是用来全选全消的，这个不算，不用自加
	                        num++;
	                    }
	                }
	            }
	        }
	        ///alert(num);
	        if (!del) {
	            if (num > 1) {
	                alert("此操作不允许选择多个事件");
	                rt = false;
	            }
	        }
	        if (str == 'del') {
	            if (num == 0) {
	                alert("你没有选择要删除的信息");
	                rt = false
	            } else { return confirm('你确定要删除这些信息吗?'); }
	            ///alert(rt);
	        }
	        else {
	            if (str == 'update') {
	                if (num == 0) {
	                    alert("你没有选择要更新的信息");
	                    rt = false
	                } else { return confirm('你确定要更新这些信息吗?'); }
	                ///alert(rt);
	            }
	        }
	        return rt;
	    }

	    function SelectAll(sa) {
	        ///全选/全消
	        var objCheckBox;
	        for (var i = 0; i < form1.length; i++) {
	            if (form1.elements[i].type == "checkbox") {
	                objCheckBox = form1.elements[i];
	                objCheckBox.checked = sa;
	            }
	        }
	    }
</script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
<table  width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#F1F4F7">
<tr>
<td height="382" align="center" valign="top">
 <table id="tblSearch" runat="server" width="98%" border="0" cellpadding="0" cellspacing="4" bgcolor="#FAFBFC" class="img" style="border-bottom:0;">
    <tr>
      <td width="2%"><img height="22" alt="SEARCH" src="../images/icon_search.gif" width="26" border="0" /></td>
                   <td width="8%">                
          <asp:DropDownList ID="ddlProvence" runat="server"  AutoPostBack="true"
              onselectedindexchanged="ddlProvence_SelectedIndexChanged">
          </asp:DropDownList>      
      </td>
         <td id="tdLevelName" runat="server" width="12%" style="text-align:right;">查找商家级别</td>
           <td id="tdLevelValue" runat="server" width="12%">
              <asp:DropDownList ID="ddlLevel" runat="server"    AutoPostBack="true"
                   onselectedindexchanged="ddlLevel_SelectedIndexChanged">
              </asp:DropDownList>
            </td>
      
       <td id="tdCompany" runat="server" width="8%" style="text-align:right;">商家</td>
      <td id="tdCompanySelect" runat="server" width="24%">
              <asp:DropDownList ID="ddlCompany" runat="server">
              </asp:DropDownList>
            </td>

            <td id="tdResultLevel" runat="server" width="10%" style="text-align:right;">筛选级别</td>
           <td id="tdResultLevelValue" runat="server" width="12%">
              <asp:DropDownList ID="ddlLevleResult" runat="server" > </asp:DropDownList>
            </td>

            <td width="12%" >商家关键字</td>
           <td width="10%"><asp:TextBox id="txtKeywords" runat="server"></asp:TextBox> </td>

            <td style="text-align:right;">&nbsp;</td>
          <td>
          <asp:ImageButton ID="ibtnSearch" ImageUrl="../images/button04.gif" runat="server" OnClick="ibtnSearch_Click" />
          </td>
      </tr>
      </table>

  <br />
  
<asp:GridView ID="GridView1" runat="server" Width="98%" CellPadding="4" 
        ForeColor="#333333" DataKeyNames="id" AutoGenerateColumns="False" 
        AllowPaging="True" pagesize="100" BorderStyle="Solid" BorderWidth="1px" 
      ShowFooter="false" EmptyDataText="没有数据记录！！" AllowSorting="True" 
        OnSorting="GridView1_Sorting" onrowdatabound="GridView1_RowDataBound" 
        onrowcommand="GridView1_RowCommand">
        <Columns>
            <asp:TemplateField ShowHeader="False" Visible="false" HeaderText="选择">
             <ItemStyle Width="30px" Wrap="False" />
             <HeaderTemplate>
                 <asp:CheckBox ID="CheckBox1" runat="server"></asp:CheckBox>
             </HeaderTemplate>
             <ItemTemplate>
                 <asp:CheckBox ID="CheckBox1" runat="server"></asp:CheckBox>
             </ItemTemplate>
            </asp:TemplateField>
         <asp:BoundField HeaderText="编号" DataField="CompanyCode" sortexpression="CompanyCode" />
        <asp:BoundField HeaderText="公司名称" DataField="Name" sortexpression="Name" />
        <asp:BoundField HeaderText="级别" DataField="CompanyLevel" HeaderStyle-Width="100px" sortexpression="CompanyLevel" />
        <asp:BoundField HeaderText="公司地址" DataField="Address" HeaderStyle-Width="120px" sortexpression="Address" />        
          <asp:BoundField HeaderText="Email" DataField="Email" sortexpression="Telephone" />
          <asp:BoundField HeaderText="公司负责人" DataField="CompanyManager" sortexpression="CompanyManager" />
        <asp:BoundField HeaderText="负责人电话" DataField="CompanyManagerMobile" sortexpression="CompanyManagerMobile" />
          <asp:BoundField HeaderText="联系人" DataField="Linker" HeaderStyle-Width="80px" sortexpression="Linker" />
           <asp:BoundField HeaderText="联系电话" DataField="Telephone" sortexpression="Telephone" />

        <asp:TemplateField ShowHeader="False" HeaderText="操作" HeaderStyle-Width="60px">
             <ItemTemplate>
             <div style=" float:left;">

             <div style="float:left; display:block;" id="divEdit" runat="server">  <a onclick="openNewTab('<%# "商家编辑-" + Eval("id") %>','company/companyManager.aspx?id=<%# Eval("id") %>&type=<%= ParamentType %>')" title="编辑"><img height="16" src="../images/icon_edit.gif" width="16" border="0" /></a></div>
          <div style="float:left; display:block;" id="divDeleted" runat="server"> <a  title="移除" href="companyManager.aspx?action=del&amp;id=<%# Eval("id") %>&type=<%= ParamentType %>" onclick="javascript:return confirm('你确定要删除这个商家吗?');"><img height="16" src="../images/icon_drop.gif" width="16" border="0" /></a></div>
          <div style="float:left; display:block;" id="divUser" runat="server"> <a onclick="openNewTab('<%# "用户中心-" + Eval("id") %>','Company/CompanyUserList.aspx?id=<%# Eval("id") %>')" title="用户中心"><img height="16" src="../images/icon_user.gif" width="16" border="0" /></a> </div>
            </div>
             </ItemTemplate>
        </asp:TemplateField>
        </Columns>
             <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />             
             <PagerStyle BackColor="White" ForeColor="#333333" HorizontalAlign="Center" Font-Bold="True" Font-Size=30px />
             <HeaderStyle BackColor="#E2E7EB" Font-Bold="True" ForeColor="Black" HorizontalAlign="Left" />
             <AlternatingRowStyle BackColor="White" />
             <PagerSettings Visible="False" />
        </asp:GridView>
        <table Width="98%" border="0" cellspacing="0" cellpadding="0">
       <tr>
         <td>&nbsp;</td>
         <td height="25" align="right" bgcolor="#E9ECEF"><asp:Label ID="LblRecordCount" runat="server"></asp:Label>
            <asp:Label ID="LblCurrentIndex" runat="server"></asp:Label>
            <asp:Label ID="LblPageCount" runat="server"></asp:Label>
            &nbsp;&nbsp;&nbsp;&nbsp;
            <asp:LinkButton ID="btnFirst" CommandArgument="first" OnClick="PagerButtonClick" runat="server">首 页</asp:LinkButton> 
            <asp:LinkButton ID="btnPrev" CommandArgument="prev" OnClick="PagerButtonClick" runat="server">上一页</asp:LinkButton> 
            <asp:LinkButton ID="btnNext" CommandArgument="next" OnClick="PagerButtonClick" runat="server">下一页</asp:LinkButton> 
            <asp:LinkButton ID="btnLast" CommandArgument="last" OnClick="PagerButtonClick" runat="server">尾 页</asp:LinkButton> 
             跳转到第<asp:DropDownList ID="ddlCurrentPage" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged"> </asp:DropDownList>页&nbsp;
         </td>
       </tr>
    </table>
</td>
    </tr>
  </table>
    </div>
    </form>
</body>
</html>
